package clases;

import java.util.List;

import es.deusto.ingenieria.is.csp.formulation.Constraint;
import es.deusto.ingenieria.is.csp.formulation.Variable;

public class LeadDigitConstraint extends Constraint<Integer> {

	public LeadDigitConstraint(String name, List<Variable<Integer>> variables) {
		super(name, variables);
	}

	@Override
	public boolean isSatisfied(Variable<Integer> var, Integer valueToAssign) {
		int ultimacol = ((Letter) var).getLocations().size();
		if (valueToAssign == 0 && ((Letter) var).getLocations().get(ultimacol).get(1) > 0) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return null;
	}

}
